<template>
  <div>
    <h1>注册账号</h1>
    <div>
      <el-form
        :label-position="labelPosition"
        label-width="80px"
        :model="formLabelAlign"
      >
        <el-form-item label="用户id">
          <el-input v-model="formLabelAlign.userid"></el-input>
        </el-form-item>
        <el-form-item label="姓名">
          <el-input v-model="formLabelAlign.name"></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input v-model="formLabelAlign.phone"></el-input>
        </el-form-item>
        <el-form-item label="邮箱">
          <el-input v-model="formLabelAlign.email"></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-input v-model="formLabelAlign.sex"></el-input>
        </el-form-item>
        <el-form-item label="银行卡">
          <el-input v-model="formLabelAlign.bankcard"></el-input>
        </el-form-item>
        <el-form-item label="班级">
          <el-input v-model="formLabelAlign.className"></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input v-model="formLabelAlign.password"></el-input>
        </el-form-item>
      </el-form>
    </div>
    <el-button type="primary" @click="submit">提交</el-button>
  </div>
</template>

<script>
import {register} from '../../api/login'
export default {
  name: "registerCom",
  data(){
    return{
        formLabelAlign: {}
    }
  },
  methods:{
    submit(){
        register(this.formLabelAlign).then(res=>{
            console.log(res);
            this.$router.replace({
             path: '/login'
        })
        })
    }
  }
};
</script>

<style lang="scss" scoped></style>
